﻿using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Routing;
using Orchard.Mvc.Routes;

namespace Amba.ULogin
{
    public class Routes : IRouteProvider
    {
        public void GetRoutes(ICollection<RouteDescriptor> routes)
        {
            foreach (var routeDescriptor in GetRoutes())
            {
                routes.Add(routeDescriptor);
            }
        }

        public IEnumerable<RouteDescriptor> GetRoutes()
        {
            var routes = new List<RouteDescriptor>();
            routes.Add(new RouteDescriptor
            {
                Priority = 1,
                Route = new Route(
                    "ulogin/login",
                    new RouteValueDictionary
                    {
                        {"area", "Amba.ULogin"},
                        {"controller", "ULogin"},
                        {"action", "Login"}
                    },
                    new RouteValueDictionary(),
                    new RouteValueDictionary {{"area", "Amba.ULogin"}},
                    new MvcRouteHandler())
            });

            return routes;
        }
    }
}